#include"Heap.h"

HeapSort(int* a, int n)
{
	for (int i = 1; i < n; i++)
	{
		AdjustUp(a, i);
	}

	int end = n - 1;
	while (end > 0)
	{
		swap(&a[0], &a[end]);
		AdjustDown(a, end, 0);
		--end;

	}

}

void test01()
{
	int a[] = { 6,3,8,4,9 };
	HeapSort(a, sizeof(a) / sizeof(int));
}

int main()
{
	test01();
	return 0;
}